package com.taxshare.purchaser.remote;

import com.taxshare.purchaser.aspect.PLog;
import com.taxshare.purchaser.view.dto.*;
import com.taxshare.response.beans.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: ApiClientService
 * @Description:
 * @author: luozhongyi
 * @date: 2021/4/1 9:35
 */
@FeignClient(name = "tax-api", fallback = ApiClientService.ApiClientServiceImpl.class)
@Component
public interface ApiClientService {

    /**
     * 电子底账库同步
     * @param bean
     * @return
     */
    @PLog
    @RequestMapping(value = "/purchaserAuth/invoice/sync", method = RequestMethod.POST)
    Response sync(@RequestBody InvoiceSyncDTO bean);

    /**
     * 黑名单同步
     * @param blackSyncDTO
     * @return
     */
    @PLog
    @RequestMapping(value = "/manager/black/sync",method = RequestMethod.POST)
    Response syncBlack( BlackSyncDTO blackSyncDTO);


    /**
     * 获取公司税款所属期
     * @param purchaserTaxNo
     * @return
     */
    @PLog
    @RequestMapping(value = "/purchaserAuth/company/period", method = RequestMethod.POST)
    Response period(@RequestBody String purchaserTaxNo);

    /**
     * 发票认证
     * @param bean
     * @return
     */
    @PLog
    @RequestMapping(value = "/purchaserAuth/invoice/auth", method = RequestMethod.POST)
    Response auth(@RequestBody InvoiceAuthBodyDTO bean);

    /**
     * 发票认证申请
     * @param bean
     * @return
     */
    @PLog
    @RequestMapping(value = "/purchaserAuth/invoice/apply", method = RequestMethod.POST)
    Response apply(@RequestBody ApplyDTO bean);

    /**
     * 发票认证申请结果
     * @param bean
     * @return
     */
    @PLog
    @RequestMapping(value = "/purchaserAuth/invoice/applyResult", method = RequestMethod.POST)
    Response applyResult(@RequestBody ApplyResultDTO bean);

    /**
     * 发票签名确认
     * @param bean
     * @return
     */
    @PLog
    @RequestMapping(value = "/purchaserAuth/invoice/confirm", method = RequestMethod.POST)
    Response confirm(@RequestBody ConfirmApplyDTO bean);

    /**
     * 发票签名确认结果
     * @param bean
     * @return
     */
    @PLog
    @RequestMapping(value = "/purchaserAuth/invoice/confirmResult", method = RequestMethod.POST)
    Response confirmResult(@RequestBody ConfirmApplyResultDTO bean);

    /**
     * 发票查验
     * @param checkInvoiceDTO
     * @return
     */
    @PLog
    @RequestMapping(value = "/purchaser/invoiceCheck", method = RequestMethod.POST)
    Response invoiceCheck(@RequestBody CheckInvoiceDTO checkInvoiceDTO);

    /**
     * 发票影像识别接口
     * @param bean
     * @return
     */
    @PLog
    @RequestMapping(value = "/purchaser/invoiceImageRecognition", method = RequestMethod.POST)
    Response invoiceDiscern(@RequestBody ImageUploadInvoiceDTO bean);

    @Component
    class ApiClientServiceImpl implements ApiClientService {
        @Override
        public Response sync(@RequestBody InvoiceSyncDTO bean) {
            return null;
        }

        @Override
        public Response syncBlack(BlackSyncDTO blackSyncDTO ) {
            return null;
        }

        @Override
        public Response period(@RequestBody String purchaserTaxNo) {
            return null;
        }

        @Override
        public Response auth(@RequestBody InvoiceAuthBodyDTO bean) {
            return null;
        }

        @Override
        public Response apply(@RequestBody ApplyDTO bean) {
            return null;
        }

        @Override
        public Response applyResult(@RequestBody ApplyResultDTO bean) {
            return null;
        }

        @Override
        public Response confirm(@RequestBody ConfirmApplyDTO bean) {
            return null;
        }

        @Override
        public Response confirmResult(@RequestBody ConfirmApplyResultDTO bean) {
            return null;
        }

        @Override
        public Response invoiceDiscern(@RequestBody ImageUploadInvoiceDTO bean){
            return null;
        }

        @Override
        public Response invoiceCheck(@RequestBody CheckInvoiceDTO checkInvoiceDTO) {
            return null;
        }

    }
}
